#ifndef UTIL_H_
#define UTIL_H_

#include <SFML/Graphics.hpp>
#include <iostream>
#include <cmath>
using namespace sf;

void normalize(Vector2f&);
Vector2f calculateOrthogonalVector(Vector2f);
bool isNullVector(const Vector2f& vector);
void drawRectInImage(Image& image, Shape& shape);
void drawTriangleInImage(Image& image, Shape& shape);
float getSmallAngle(Vector2f u, Vector2f v);
float calcJ(Vector2f p, Vector2f u, Vector2f v, float x, float y);
float calcI(Vector2f p, Vector2f u, Vector2f v, float x, float y, float j);
float length(Vector2f v);
float scalarProduct(Vector2f u, Vector2f v);
bool intersect(Vector2f p1, Vector2f v1, Vector2f p2, Vector2f v2);
float calcA1(Vector2f p1, Vector2f v1, Vector2f p2, Vector2f v2, float a2);
float calcA2(Vector2f p1, Vector2f v1, Vector2f p2, Vector2f v2);

#endif /* UTIL_H_ */
